package com.cy.pj.common.poll;

import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Scope("singleton")
@Lazy //描述的类的对象可以延迟其创建
@Component
public class ObjectPoll {
    public ObjectPoll(){
        System.out.println("ObjectPool()");
    }
    @PostConstruct
    public void init(){
        System.out.println("init()");
    }
    @PreDestroy
    public void destroy(){
        System.out.println("destroy()");
    }
}
